package com.yuwen.yuwenRPC.config;

/**
 * @ClassNameRpcConfig
 * @Description TODO
 * @Author钰玟
 * @Date2025/3/30 下午12:46
 * @Version 1.0
 **/

import com.yuwen.yuwenRPC.fault.RetryStrategyKeys;
import com.yuwen.yuwenRPC.fault.tolerant.TolerantStrategyKeys;
import com.yuwen.yuwenRPC.loadbalancer.LoadBalancer;
import com.yuwen.yuwenRPC.loadbalancer.LoadBalancerKeys;
import com.yuwen.yuwenRPC.registry.RegistryKeys;
import com.yuwen.yuwenRPC.serializer.JdkSerializer;
import com.yuwen.yuwenRPC.serializer.Serializer;
import com.yuwen.yuwenRPC.serializer.SerializerKeys;
import lombok.Data;

/**
 * rpc框架配置类
 */
@Data
public class RpcConfig {

    /**
     * 名称
     */
    private String name = "yuwen-rpc";
    /**
     * 版本
     */
    private String version = "1.0.0";
    /**
     * 服务主机名
     */
    private String host = "localhost";
    /**
     * 服务端口号
     */
    private Integer port = 8080;

    /**
     * 是否开启mock服务 默认关闭
     */
    private boolean mock =false;

    /**
     *序列化器(名称)
     */
    private String serializer = SerializerKeys.JDK;

    /**
     * rpc框架注册中心配置
     */
    private RegistryConfig registryConfig = new RegistryConfig();

    /**
     * 负载均衡器
     */
    private String loadBalancer = LoadBalancerKeys.ROUND_ROBIN;

    /**
     * 重试机制
     */
    private String retryStrategy = RetryStrategyKeys.FIXED_INTERVAL;

    /**
     * 容错机制
     */
    private String tolerantStrategy = TolerantStrategyKeys.FAIL_FAST;
}
